<?php
class Wall_Form_Admin_Settings_General extends Engine_Form
{
  public function init()
  {
    // Set form attributes
    $this->setTitle('Wall Settings');
    $this->setDescription('Setting for Advance Wall module');
    
//    $this->addElement('Radio', 'richeditor_enable', array(
//          'label' => 'Enable RichText Editor',
//          'description' => 'Do you want to enable TinyMCE Editor or not?',
//          'value' => 0,
//          'multiOptions' => array(
//            1 => 'Yes, enable TinyMCE Editor.',
//            0 => 'No, disable TinyMCE, use default composer.'
//          )
//       )
//     );
    $this->addElement('Text', 'autoload_limit', array(
        'label' => 'Times of autoload feeds',
        'description' => 'Enter the maximum times of autoload feeds (the feeds will be loaded automatically while scrolling page down).',
        'maxlength' => '4',
        'validators' => array(
          array('Int', true),
          new Engine_Validate_AtLeast(0),
        ),
      ));
    
    $this->addElement('Button', 'submit', array(
      'label' => 'Save Changes',
      'type' => 'submit',
      'ignore' => true
    ));
  }

  public function renderForm()
  {
      $values = $this->getAttrib('values');
//      $this->richeditor_enable
//           ->setValue($values['richeditor']['enable']);
      $this->autoload_limit
           ->setValue($values['autoload']['limit']);
  }
}